package com.yvon.maple.service.system.bo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.yvon.boot.excel.annotation.ExcelDictFormat;
import com.yvon.boot.excel.annotation.ExcelEnumFormat;
import com.yvon.boot.excel.annotation.LocalDateTimeFormat;
import com.yvon.boot.excel.converter.ExcelBigNumberConvert;
import com.yvon.boot.excel.converter.ExcelDictConvert;
import com.yvon.boot.excel.converter.ExcelEnumConverter;
import com.yvon.boot.excel.converter.LocalDateTimeExcelConverter;
import com.yvon.maple.enums.GenderEnum;
import com.yvon.maple.enums.UserTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserBo implements Serializable {

	/**
	 * id
	 */
	@ExcelProperty(value = "ID", converter = ExcelBigNumberConvert.class)
	private Long id;

	/**
	 * 创建时间
	 */
	@ExcelProperty(value = "创建时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime createTime;

	/**
	 * 更新时间
	 */
	@ExcelProperty(value = "更新时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime updateTime;

	/**
	 * 密码
	 */
	@ExcelProperty(value = "密码")
	private String password;

	/**
	 * 用户名
	 */
	@ExcelProperty(value = "用户名")
	private String username;

	/**
	 * 昵称
	 */
	@ExcelProperty(value = "昵称")
	private String nickname;

	/**
	 * 电话
	 */
	@ExcelProperty(value = "电话")
	private String phone;


	/**
	 * 电话
	 */
	@ExcelProperty(value = "密码")
	private String email;

	/**
	 * 性别(1-男，2-女，3-保密)默认为3
	 */
	@ExcelProperty(value = "性别", converter = ExcelEnumConverter.class)
	@ExcelEnumFormat(enumClass = GenderEnum.class, textField = "message")
	private GenderEnum gender;


	/**
	 * Account non expired
	 */
	@ExcelProperty(value = "帐户未过期", converter = ExcelDictConvert.class)
	@ExcelDictFormat(readConverterExp = "true=是,false=否")
	private Boolean accountNonExpired = true;

	/**
	 * Account non locked
	 */
	@ExcelProperty(value = "帐户未锁定", converter = ExcelDictConvert.class)
	@ExcelDictFormat(readConverterExp = "true=是,false=否")
	private Boolean accountNonLocked = true;

	/**
	 * Credentials non expired
	 */
	@ExcelProperty(value = "凭据未过期", converter = ExcelDictConvert.class)
	@ExcelDictFormat(readConverterExp = "true=是,false=否")
	private Boolean credentialsNonExpired = true;

	/**
	 * Enabled
	 */
	@ExcelProperty(value = "启用", converter = ExcelDictConvert.class)
	@ExcelDictFormat(readConverterExp = "true=是,false=否")
	private Boolean enabled = true;

	@ExcelProperty(value = "类型", converter = ExcelEnumConverter.class)
	@ExcelEnumFormat(enumClass = UserTypeEnum.class, textField = "message")
	private UserTypeEnum userType;
}
